import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)

const routes = [
 
  {
    path: '/login',
    name: 'login',
    component: () => import( '../views/Login.vue')
  },
  {
    path: '/admin',
    name: 'admin',
    component: () => import( '../views/Admin.vue'),
    children:[
      { //用户列表
        path: '/userlist',
        name: 'userlist',
        component: () => import( '../views/User/userList.vue'),
        meta: {
          requireAuth: true,
          titie:'用户列表'
        }
      },
      { //角色列表
        path: '/rolelist',
        name: 'rolelist',
        component: () => import( '../views/Limits/Rolelist.vue')
      },
      { //权限列表
        path: '/limitslist',
        name: 'limitslist',
        component: () => import( '../views/Limits/Limitslist.vue')
      },
      { //商品列表
        path: '/goodslist',
        name: 'goodslist',
        component: () => import( '../views/Goods/Goodslist.vue')
      },
      { //分类参数
        path: '/sort',
        name: 'sort',
        component: () => import( '../views/Goods/Sort.vue')
      },
      { //商品分类
        path: '/goodssort',
        name: 'goodssort',
        component: () => import( '../views/Goods/Goodssort.vue')
      },
      { //添加商品信息
        path: '/goodsinfo',
        name: 'goodsinfo',
        component: () => import( '../views/Goods/goodsinfo.vue')
      },
      { //订单列表
        path: '/orderlist',
        name: 'orderlist',
        component: () => import( '../views/Order/Orderlist.vue')
      },
      { //数据报表
        path: '/datalist',
        name: 'datalist',
        component: () => import( '../views/Data/Datalist.vue')
      },
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
